package com.scala.spark

import org.apache.spark.sql.SparkSession

object ActionOperation {
    def main(args: Array[String]): Unit = {
        val spark = SparkSession.builder().appName("action").master("local").getOrCreate()
        import spark.implicits._
        val employee=spark.read.json("employee")
        employee.collect().foreach(println(_))
        println(employee.count())//
        println(employee.map(employee => 1).reduce(_ + _))
        employee.show()
        employee.take(3).foreach(println(_))
    }

}















